package Test;
import java.util.*;
class Fish{
	int weight;
	String name;
}
class Lake{
	Fish fish;
	String name;
	void sitFish(Fish a) {
		this.fish = a;
		System.out.println("把"+a.name+"放到鱼缸里");
	}
	void fisheat(int a) {
		fish.weight=fish.weight+a;
		System.out.println("给"+this.name+"中的"+this.fish.name+"喂了"+a+"鱼食");
	}
}
public class Test{
	static void rt(Lake a) {
		if (a.fish == null ) {System.out.println(a.name+"中没有鱼");} else {System.out.println(a.name+"的鱼有"+a.fish.name+" 重量是"+a.fish.weight);}
	}
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			int yushi;
			Fish jinyu = new Fish();jinyu.name="金鱼";
			System.out.println("金鱼的重量是"+jinyu.weight);
			Lake yugang = new Lake(),shuichi = new Lake(),yongchi = new Lake();//初始化三个lack
			yugang.name="鱼缸";
			shuichi.name="水池";
		    yongchi.name="泳池";
            rt(yugang);
            rt(shuichi);
            rt(yongchi);
			yugang.sitFish(jinyu);
			shuichi.sitFish(jinyu);
			rt(yugang);
            rt(shuichi);
            rt(yongchi);
			yongchi.sitFish(jinyu);
			rt(yugang);
            rt(shuichi);
            rt(yongchi);
        	  System.out.println("给鱼缸中的鱼喂"); 
              yushi=sc.nextInt();
              yugang.fisheat(yushi);
            rt(yugang);
            rt(shuichi);
            rt(yongchi);
              System.out.println("给水池中的鱼喂"); 
              yushi=sc.nextInt();
              shuichi.fisheat(yushi);
            rt(yugang);
            rt(shuichi);
            rt(yongchi);
              System.out.println("给水池中的鱼喂"); 
              yushi=sc.nextInt();
              yongchi.fisheat(yushi);
            rt(yugang);
            rt(shuichi);
            rt(yongchi);
          
		}
	}
}